import React from 'react';
import { Router, Route, IndexRoute } from 'react-router';

import main from './containers/homepage';
import article from './containers/articlepage';
import register from './containers/registerpage';
import reviewerpage from './containers/reviewerpage';
import searchpage from './containers/searchpage';
import favoritepage from './containers/favoritepage';
import reviewpage from './containers/reviewpage';
import approvalpage from './containers/approvalpage';
import mysettingpage from './containers/mysettingpage';
import error500 from './error500';
import view500page from './view500page';
import MainView from './containers/mainView';
import WaittingForApproval from './containers/WaittingForApproval';
import ArticlesPage from './containers/ArticlesPage';
import noticepage from './containers/noticepage';
import aboutpage from './containers/aboutpage';
import aacepage from './containers/aacepage';
import adapage from './containers/adapage';
import easdpage from './containers/easdpage';
import idfpage from './containers/idfpage';
import conferencelist from './containers/conferencelist';
import commentpage from './containers/commentpage';

export default (
  <Router path="/">
      <IndexRoute component={register}/>
      <Route path="main/:openid(/:url)" component={MainView}/>
      <Route path="main/:openid(/:url/:param1)" component={MainView}/>
      
      <Route path="home" component={main}/>
      <Route path="articles/:channel/:page/:sort" component={ArticlesPage}/>
      <Route path="register/:openid" component={register}/>
      <Route path="reviewer/:openid" component={reviewerpage}/>
      <Route path="article/:articleId(/:comment)" component={article}/>
      <Route path="comment/:articleId" component={commentpage}/>
      <Route path="favorites" component={favoritepage}/>
      <Route path="legislation" component={noticepage}/>
      <Route path="about" component={aboutpage}/>
      <Route path="approvalpage" component={approvalpage}/>

      <Route path="searchpage/:channel/:page/:sort(/:query)" component={searchpage}/>
      
      <Route path="review/:articleId(/:openid)" component={reviewpage}/>
      <Route path="conference/aace" component={aacepage}/>
      <Route path="conference/ada" component={adapage}/>
      <Route path="conference/easd" component={easdpage}/>
      <Route path="conference/idf" component={idfpage}/>
      <Route path="conference/list(/:channel)(/:page)" component={conferencelist}/>

      <Route path="500error" component={error500}/>

      <Route path="*" component={view500page}/>
  </Router>
);